<template>
    <div class="detail">
        详情页
        {{bbsInfo}}
    </div>
</template>

<script>
import { getBbsDetail } from "@/api/bbs";
export default {
    name: 'detail',
    data() {
        return {
            bbsid: 0,
            bbsInfo: {}
        }
    },
    created() {
        if(this.$route.params.id) {
            this.bbsid=this.$route.params.id;
        }
        this.loadData()
    },
    methods: {
        loadData() {
            if (this.bbsid != 0) {
                getBbsDetail(this.bbsid).then(response => {
                    console.log(response)
                    if (response.data.ok) {
                        this.bbsInfo = response.data.data
                    }
                })
            } else {
                this.$message.warning("无数据！")
            }
        }
    }
}
</script>

<style lang="scss" scoped>
.detail{
    
}
</style>